<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link href="__ADMIN_ACEADMIN__/css/bootstrap.min.css" rel="stylesheet"/>
    <style type="text/css">
        .mt-15{ margin-top: 15px; }
    </style>
    <title>订单退款</title>
</head>
<body>
    <div class="col-xs-12 clearfix mt-15">
        <label for="balance" class="col-xs-4">订单编号：</label>
        <div class="col-xs-8"><{$_GET['orderNum']}></div>
    </div>

    <div class="col-xs-12 clearfix mt-15">
        <label for="balance" class="col-xs-4">实收金额：</label>
        <div class="col-xs-8"><input id="balance" type="number" class="form-control" placeholder="实收金额" /></div>
    </div>
    <div class="col-xs-12 clearfix mt-15">
        <label for="refuse" class="col-xs-4">可退金额：</label>
        <div class="col-xs-8"><input id="refuse" type="number" class="form-control" placeholder="可退金额：" /></div>
    </div>

    <div class="col-xs-12 clearfix mt-15 text-center">
        <button class="btn btn-primary" onclick="refuse()">确认退款</button>
    </div>
<script src="__PUBLIC__/statics/js/jquery-1.10.2.min.js"></script>
<script src="__JS__/layer.js"></script>
<script>
var $refuse = $('#refuse');
var $balance = $('#balance');
function refuse () {
    if(!$refuse.val()){
        layer.msg('请输入可退金额');
        $refuse.focus();
        return false;
    }

    if(!$balance.val()){
        layer.msg('请输入结算金额');
        $balance.focus();
        return false;
    }

    $.post('<{:U('refuse')}>', { order_id:  <{$order_id}>, back_money: $refuse.val(), close_money: $balance.val()}, (data)=>{
        layer.msg(data.msg);
        if(data.status == 1){
            setTimeout(function(){
                parent.location.reload();
            },1500);
        }
    }, 'json');
}
</script>
</body>

</html>



